import * as constants from '../Constants'
import { get, GET_PUSH_LIST } from '../../service/api'

export interface GetPushList {
  type: constants.GetPushList
  payload: Promise<any>
}
export interface GetPushList_PENDING {
  type: constants.GetPushList_PENDING
  payload: Promise<any>
}
export interface GetPushList_FULFILLED {
  type: constants.GetPushList_FULFILLED
  payload: any
}
export interface GetPushList_Type {
  type: constants.GetPushList_Type
  payload: number
}


export type PushAction = GetPushList | 
  GetPushList_FULFILLED | 
  GetPushList_PENDING |
  GetPushList_Type

export function recordType(param: number): GetPushList_Type {
  return {
    type: constants.GetPushList_Type,
    payload: param
  }
}

export function getPushList(param: any): GetPushList {
  return {
    type: constants.GetPushList,
    payload: get(GET_PUSH_LIST, param)
  }
}